#ifndef __PLATFORM_OTYPES_H__
#define __PLATFORM_OTYPES_H__

namespace platform
{
	enum oAttackType
	{
		e_attackMelee = 0,
		e_attackRange = 1
	};
	enum oAttackTarget
	{
		e_targetOne = 0,
		e_targetMulti = 1
	};
	enum oRelation
	{
		e_unkown = 0,
		e_friend = 1<<0,
		e_neutral = 1<<1,
		e_enemy = 1<<2,
		e_anyRelation = e_friend|e_neutral|e_enemy
	};
	enum oDamageType
	{
		e_damageOne = 0,
		e_damageTwo = 1,
		e_damageThree = 2,
		e_damageFour = 3,
		e_damageFive = 4,
		e_damageSix = 5
	};
	enum oDefenceType
	{
		e_defenceOne = 0,
		e_defenceTwo = 1<<16,
		e_defenceThree = 2<<16,
		e_defenceFour = 3<<16,
		e_defenceFive = 4<<16,
		e_defenceSix = 5<<16
	};
	
	/*
	oRelation
		e_unkown 0
		e_friend 1<<0
		e_neutral 1<<1
		e_enemy 1<<2
	oGroup
		oSharedData.getTerrainGroup() 1<<3
	*/
	class oDLL oTargetAllow
	{
	public:
		oTargetAllow();
		void allowTerrain(bool var);
		bool isTerrainAllowed() const;
		void allow(oRelation flag);
		void disallow(oRelation flag);
		bool isAllow(oRelation flag);
	protected:
		uint32 _flag;
	};

	struct oUnitXml
	{
		enum
		{
			Dorothy = 'A',
			Unit = 'B',
			TargetAllow = 'C',
			Rectangle = 'D',
			Polygon = 'E',
			Loop = 'F',
			Vertex = 'G',
			Circle = 'H',

			Name = 'A',
			Desc = 'B',
			Size = 'C',
			Density = 'D',
			Friction = 'E',
			Restitution = 'F',
			IsStatic = 'G',
			Model = 'H',
			Move = 'I',
			DetectDistance = 'J',
			MaxHp = 'K',
			Attack = 'L',
			AttackDelay = 'M',
			AttackEffectDelay = 'N',
			AttackDistance = 'O',
			AttackType = 'P',
			AttackTarget = 'Q',
			DamageType = 'R',
			DefenceType = 'S',
			BulletType = 'T',
			AttackEffect = 'U',
			HitEffect = 'V',
			SndAttack = 'W',
			SndDeath = 'X',
			Actions = 'Y',
			Sensity = 'Z',

			Friend = 'A',
			Neutral = 'B',
			Enemy = 'C',
			Terrain = 'D',

			Center = 'A',
			Width = 'B',
			Height = 'C',
// 			Density = 'D',
// 			Friction = 'E',
// 			Restitution = 'F',
			Angle = 'G',

			Pos = 'A',

			Radius = 'B'
		};
	};

	struct oBulletXml
	{
		enum
		{
			Dorothy = 'A',
			Bullet = 'B',
			Face = 'C',
			Angle = 'A',
			Speed = 'B',
			IsHighSpeed = 'C',
			GravityFactor = 'D',
			Str = 'E'
		};
	};

	struct oAIXml
	{
		enum
		{
			Dorothy = 'A',
			Reflection = 'B',
			SelNode = 'C',
			SeqNode = 'D',
			ParSelNode = 'E',
			ParSeqNode = 'F',
			ConNode = 'G',
			ActNode = 'H',
			Exp = 'I',
			Val = 'J',
			Instinct = 'K',
			True = 'L',
			False = 'M',
			Compare = 'N',

			Name = 'A',
			Property = 'B',

			ID='A',
			Relation='C',
			Action='D',
			Type='E',
			Tag='F',

			Op='A',
			Value='B'
		};
	};
}

#endif
